const Koa = require("koa");
const app = new Koa();
const body = require("koa-body");
const jsonwebtoken = require("jsonwebtoken");
// 接口防刷
const limitApi = require("./utils/api-limit");
// 路由合并
const combineRouter = require("./routes");

const token = jsonwebtoken.sign({ username: " chengang" }, "xxxxxx", {
  expiresIn: "3d",
});
const info = jsonwebtoken.verify(token, "xxxxxx");
console.log("xxx");
console.log(info, "info");
console.log(token, "token");

limitApi(app);

app.use(body());
combineRouter(app);

app.listen(3000);
